package pers.whj.rpc.protocol;

/**
 * 表示网络传输地址，包含ip和port
 */
public class Address {
    private String host;
    private int port;

    public Address(String host, int port) {
        this.host = host;
        this.port = port;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public String toString() {
        String result = "";
        if (host != null) {
            result = result + host + ":" + port;
        }
        return result;
    }
}
